package MapDemo;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapOtherFunctionDemo {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("001","张三");
        map.put("002","李四");
        map.put("003","王二");
        map.put("004","麻子");
        map.put("005","王五");
        map.put("006","麻子");
        int size = map.size();
        System.out.println("map的长度" + size);
        Collection<String> values = map.values();
        System.out.println(values);
        for (String value : values) {
            System.out.println(value);
        }
        Set<String> keys = map.keySet();
        System.out.println(keys);
        for (int i = 0; i < keys.size(); i++) {
            System.out.println(i);
        }
    }
}
